<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="grid"/>
<sys:header title="企业管理" extLibs="${extLibs}" />
<div class="portlet box ${boxStyleColor}">
	<div class="portlet-title">
		<div class="caption"><i class="fa fa-coffee"></i> 企业管理</div>
		<div class="actions">
			<a href="#" class="btn btn-default btn-sm" id="btnSearch" title="查询"><i class="fa fa-search"></i> 查询</a>
			<shiro:hasPermission name="mdm:mdmBtypeInfo:edit">
				<a href="${ctx}/mdm/mdmBtypeInfo/form" class="btn btn-default btn-sm btnTool" title="新增企业"><i class="fa fa-plus"></i> 新增</a>
			</shiro:hasPermission>
		</div>
	</div>
	<div class="portlet-body list">
		<form:form id="searchForm" modelAttribute="mdmBtypeInfo" action="${ctx}/mdm/mdmBtypeInfo/listData" method="post" class="breadcrumb form-inline hide"
				data-page-no="${page.pageNo}" data-page-size="${page.pageSize}" data-order-by="${page.orderBy}">
			<div class="form-group">
				<label class="control-label">企业名称：</label>
				<div class="input-inline">
					<form:input path="btypeName" htmlEscape="false" maxlength="100" class="form-control input-sm width-160"/>
				</div>
			</div>
			<%--<div class="form-group">--%>
				<%--<label class="control-label">区域编码：</label>--%>
				<%--<div class="input-inline">--%>
					<%--<form:select path="area.areaCode" class="form-control input-sm width-160">--%>
						<%--<form:option value="" label="全部"/>--%>
						<%--<form:options items="${fns:getDictList('btype_area')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
					<%--</form:select>--%>
				<%--</div>--%>
			<%--</div>--%>
			<div class="form-group">
				<label class="control-label">区域名称：</label>
				<div class="input-inline">
					<form:input path="areaName" htmlEscape="false" maxlength="64" class="form-control input-sm width-160"/>
				</div>
			</div>
			<%--<div class="form-group">--%>
				<%--<label class="control-label">分类编码：</label>--%>
				<%--<div class="input-inline">--%>
					<%--<form:select path="classifyCode" class="form-control input-sm width-160">--%>
						<%--<form:option value="" label="全部"/>--%>
						<%--<form:options items="${fns:getDictList('btype_classify')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
					<%--</form:select>--%>
				<%--</div>--%>
			<%--</div>--%>
			<div class="form-group">
				<label class="control-label">分类名称：</label>
				<div class="input-inline">
					<form:input path="classifyName" htmlEscape="false" maxlength="64" class="form-control input-sm width-160"/>
				</div>
			</div>
			<%--<div class="form-group">--%>
				<%--<label class="control-label">类型编码：</label>--%>
				<%--<div class="input-inline">--%>
					<%--<form:select path="typeCode" class="form-control input-sm width-160">--%>
						<%--<form:option value="" label="全部"/>--%>
						<%--<form:options items="${fns:getDictList('btype_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
					<%--</form:select>--%>
				<%--</div>--%>
			<%--</div>--%>
			<div class="form-group">
				<label class="control-label">类型名称：</label>
				<div class="input-inline">
					<form:input path="typeName" htmlEscape="false" maxlength="64" class="form-control input-sm width-160"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label">联系人：</label>
				<div class="input-inline">
					<form:input path="linkman" htmlEscape="false" maxlength="64" class="form-control input-sm width-160"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label">联系方式：</label>
				<div class="input-inline">
					<form:input path="linkmanTel" htmlEscape="false" maxlength="64" class="form-control input-sm width-160"/>
				</div>
			</div>
			<div class="form-group" style="margin-left:10px;"> 
				<input class="btn btn-primary btn-sm" type="submit" value="查询"/>&nbsp;
				<input class="btn default btn-sm" type="reset" value="重置"/>
			</div>
		</form:form>
		<table id="dataGrid"></table>
		<div id="dataGridPage"></div>
	</div>
</div>
<sys:footer extLibs="${extLibs}" />
<script type="text/javascript">
	// 初始化DataGrid对象
	$("#dataGrid").dataGrid({
		
		searchForm: $("#searchForm"), // 数据来源表单
		tabPageId: '${param.tabPageId}',// 当前页签编号
		
		// 设置数据表格列
		columnModel: [
			{header:'企业', name:'btypeName', index:'a.btype_name', width:200, align:"left", frozen:true, formatter: function(val, obj, row, act){
					return '<a href="${ctx}/mdm/mdmBtypeInfo/form?id='+row.id+'" class="btnList" data-title="编辑企业">'+(val ? val : row.id)+'</a>';
				}},
			{header:'区域市场', name:'areaName', index:'a.area_name', width:100, align:"left"},
			{header:'客户分类', name:'classifyName', index:'a.classify_name', width:100, align:"left"},
			{header:'客户类型', name:'typeName', index:'a.type_name', width:100, align:"left"},
			{header:'备案状态', name:'recordsStatus', index:'a.records_status', width:200, align:"left"},
			{header:'操作', name:'actions', width:100, fixed:true, sortable:false, formatter: function(val, obj, row, act){
				var actions = [];//<shiro:hasPermission name="mdm:mdmBtypeInfo:edit">
				if (row.status == Global.STATUS_NORMAL){
					actions.push('<a href="${ctx}/mdm/mdmBtypeInfo/form?id='+row.id+'" class="btnList" title="编辑企业"><i class="fa fa-pencil"></i></a>&nbsp;');
					actions.push('<a href="${ctx}/mdm/mdmBtypeInfo/delete?id='+row.id+'" class="btnList" title="删除该企业" data-confirm="确认要删除该企业吗？"><i class="fa fa-trash-o"></i></a>&nbsp;');
				}//</shiro:hasPermission>
				return actions.join('');
			}}
		],
		ajaxSuccess: function(data){ // 加载成功后执行方法
			
		}
	});
</script>